import apiClient from './index';

const productService = {
  // 获取商品列表
  getProducts: (params) => {
    // params 可以包含: page, limit, category_id, category_slug, search, sort_by, sort_order, is_recommended
    return apiClient.get('/products', { params });
  },

  // 获取单个商品详情
  getProduct: (idOrSlug) => {
    return apiClient.get(`/products/${idOrSlug}`);
  },

  // 检查商品库存 (如果后端有此接口)
  // checkStock: (productId, quantity) => {
  //   return apiClient.get(`/products/${productId}/stock`, { params: { quantity } });
  // }
};

export default productService; 